package com.lx.design.demo.ddd.domain;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.UUID;

/**
 * @author lx
 * @description 产品
 * @date 2021/2/5 14:53
 */
@Data
public class Product {
    private final UUID id;
    private final BigDecimal price;
    private final String name;

    @JsonCreator
    public Product(@JsonProperty("id") UUID id,@JsonProperty("price") BigDecimal price,@JsonProperty("name") String name) {
        this.id = id;
        this.price = price;
        this.name = name;
    }

}
